{{render "header.html"}}
<script type="text/javascript">
    var del_url = '{{urlpath "/admin/article/deletes"}}';
    var order_url = '{{urlpath "/admin/article/order"}}';
    var state_url = '{{urlpath "/admin/article/state"}}';
</script>
<div class="main">
    {{render "left.html"}}
    <div class="main_right">
        <div class="right_1">
            <!--右边导航s-->
            <div class="right_1_1">
                <div class="nav_left">
                    <a href="javascript:;" data-uri='{{urlpath "/admin/article/add"}}'
                        class="nav_current add event-form">添加{{.data.act}}</a>
                </div>
                <div class="nav_right">
                    <form action='{{.CommonData.CurrentPath}}' method="get" class="layui-form">
                        <div class="layui-inline layui-show-xs-block">
                            <input class="layui-input" name="keyword" placeholder="请输入关键词" autocomplete="off" value="">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input type="submit" value="搜索" class="layui-btn">
                        </div>
                    </form>
                </div>
            </div>
            <!--右边导航e-->
            <div class="right_1_2">
                <table cellspacing="0" cellpadding="0" class="list_table layui-table layui-form">
                    <tr>
                        <th width="30"><input type="checkbox" lay-filter="f_checkall" lay-skin="primary"></th>
                        <th width="30">ID</th>
                        <th><i class="require-red">*</i>标题</th>
                        <th>图片</th>
                        <th>点击量</th>
                        <th width="120">添加时间</th>
                        <th width="120">操作时间</th>
                        <th width="60">排序</th>
                        <th>显示/隐藏</th>
                        <th>操作</th>
                    </tr>
                    {{if .data.rows}}
                    {{range .data.rows}}
                    <tr class="info">
                        <td>
                            <input type="checkbox" class="J_FCheckbox" name="selected_id[]" lay-skin="primary"
                                value="{{.ID}}">
                        </td>
                        <td>
                            {{.ID}}
                        </td>
                        <td>
                            {{.Title}}
                        </td>
                        <td>
                            {{if .Img }}
                            <img src="{{.Img}}" height="65" />
                            {{else}}
                            -
                            {{end}}

                        </td>
                        <td>
                            {{.Click}}
                        </td>
                        <td>
                            {{date .AddTime "Y-m-d H:i:s"}}
                        </td>
                        <td>
                            {{date .Dateline "Y-m-d H:i:s"}}
                        </td>
                        <td>
                            <input type="text" name="paixu[]" class="input_txt sort-input" value="{{.Paixu}}" />
                        </td>
                        <td>
                            <input type="checkbox" name="switch" data-id="{{.ID}}" lay-filter="state" lay-skin="switch"
                                lay-text="显示|隐藏" {{if .IsShow}}checked{{end}}>
                        </td>
                        <td width="160px" class="handle">
                            <a href="javascript:;" data-uri='{{ urlHtmlAttr "/admin/article/edit/" .ID }}'
                                class="event-form">编辑</a>
                            &nbsp;|&nbsp;
                            <a href="javascript:;" class="event-delete"
                                data-uri='{{ urlHtmlAttr "/admin/article/delete/" .ID }}'>删除</a>
                        </td>
                    </tr>

                    {{end}}
                    <tr>
                        <td colspan="10" class="buttontd">
                            <a href="javascript:void(0);" id="batchDel">删除</a>
                            <a href="javascript:void(0);" id="updateOrd">排序</a>
                        </td>
                    </tr>

                    {{else}}
                    <tr>
                        <td colspan="10" style="text-align:center">无数据..</td>
                    </tr>
                    {{end}}
                </table>
                <div class="listpage">
                    {{.page}}
                </div>
            </div>
        </div>
    </div>
</div>
{{render "footer.html"}}